package com.dencycheng.redismq.runner;

import com.dencycheng.redismq.service.MqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;


@Component
public class MqRunner implements ApplicationRunner {

    @Autowired
    MqService mqService;

    @Override
    public void run(ApplicationArguments args) throws Exception {
        Thread thread = new Thread(() -> {
            mqService.listener();
        });
        thread.start();
    }
}
